<?php
//dezend by http://www.yunlu99.com/ QQ:270656184
defined('BASEPATH') || exit('No direct script access allowed');
?><link rel="stylesheet" href="/static/css/index.css" id="css_index">
<script type="text/javascript" src="/static/js/jquery.SuperSlide.min.js"></script>
<script type="text/javascript">
$(function(){
	var _w = $(window).width();
	if(_w < 600) {
		$('#css_index').attr('href','/static/css/m_index.css');
	}
});
</script>
<div class="banner">
    <div class="container">
		<div class="banner-login">
			
<?php
if (!$this->session->user_id) {
?>		    <div class="login_form">
			    <form action="<?php echo site_url('user/verify');?>" method="post" id="form_id">
				    <table cellspacing=0 cellpadding=0 border=0>
				    <tr>
					    <td><input type="text" name="username" placeholder="<?php echo lang('home_username');?>"><p><?php echo lang('home_username');?></p></td>
					    <td><input type="password" name="password" placeholder="<?php echo lang('home_password');?>"><p><?php echo lang('home_password');?></p></td>
				    	<td><input type="text" class="captcha_input" name="captcha" style="width:100px;" must="1" placeholder="<?php echo lang('sign_captcha_image_warn');?>"><p><?php echo lang('sign_captcha_image_warn');?></p></td>
				    	<td><span class="captcha_img"><span id="captcha"></span></span></td>
				    	<th class="warning"></th>
				   		<td><button type="submit"><?php echo lang('home_login_btn');?></button></td>
				   	</tr>
				    </table> 
			    </form>
			    <script type="text/javascript">
				$(function(){
					$('#form_id').checkForm();
					$('#captcha').load('<?php echo site_url('tool/captcha');?>');
					$('#captcha').click(function(){
						$('#captcha').load('<?php echo site_url('tool/captcha');?>');
					});
				});
			    </script>
		    </div>
		    <div class="clear"></div>
		    <?php
}
else {
?>	    	<div class="logined_box">
	    		<span>帐号：<?php echo $user['username'];?> <a style="margin-left:5px;" href="<?php echo site_url('user/log_out');?>"><strong><i class="fa fa-power-off"></i> <?php echo lang('home_exit');?></strong></a><div class="clear"></div></span>
	    		<span>UID：<strong><?php echo $user['id'];?></strong></span>
	    		<span class="btns">
	    			<a href="<?php echo site_url('into');?>"><?php echo lang('money_coin_fill');?></a>
			    	<a href="<?php echo site_url('out');?>"><?php echo lang('money_coin_draw');?></a>
			    	<a href="<?php echo site_url('item_manage');?>">项目管理</a>
			    	<a href="<?php echo site_url('safe');?>">安全中心</a>
			    	<div class="clear"></div>
	    		</span>
		    </div>
		    <?php
}

?>		</div>
    </div>

	<div id="slider-3" style="height:550px;overflow:hidden;">
		
		<div class="slider">
			<div class="bd">
				<ul>
					
<?php
foreach ($slide as $v) {
?>					<li style="background:url(/upload/slide/<?php echo $v['img'];?>) center center no-repeat;"></li>
					<?php
}

?>				</ul>
			</div>
			<ol class="hd cl dots">
				
<?php
foreach ($slide as $k => $v) {
?>				<li><?php echo $k + 1;?></li>
				<?php
}

?>			</ol>
			<a class="prev" href="javascript:void(0)"></a>
　　			<a class="next" href="javascript:void(0)"></a>
		</div>
		
	</div>
	
</div>

<div class="notice"><div class="container"><i class="fa fa-volume-down"></i><a href="<?php echo site_url('article/info/' . $notice['id']);?>">【<?php echo $notice['class_name'];?>】<?php echo $notice['title'];?></a></div></div>



<div class="items going">
	<div class="container">
		
<?php
foreach ($list as $k => $v) {
?>		<div 
<?php
	if (($k % 3) == 0) {
?>style="margin-left:0px;"<?php
	}

?> class="item 
<?php
	if ($v['stat'] == 1) {
?>going<?php
	}
	else if ($v['stat'] == 2) {
?>end<?php
	}
	else if ($v['stat'] == 0) {
?>begin<?php
	}

?>">
			<span class="status-tag">
               	 
<?php
	if ($v['stat'] == 1) {
?>进行中<?php
	}
	else if ($v['stat'] == 2) {
?>已结束<?php
	}
	else if ($v['stat'] == 0) {
?>预热中<?php
	}

?>            </span>
			<div class="img">
				<a href="<?php echo site_url('items/info');?>?id=<?php echo $v['id'];?>"><img src="/upload/item/<?php echo $v['logo'];?>"></a>
			</div>
			<div class="txt">
				<div class="tit"><a href="<?php echo site_url('items/info');?>?id=<?php echo $v['id'];?>">【<?php echo $v['coin']['en_name'];?>专场】<?php echo $v['name'];?></a></div>
				<div class="intro"><?php echo $v['intro'];?></div>
				<div class="total"><?php echo $v['coin']['en_name'];?> <?php echo $v['deal'];?></div>
				<div class="bar"><div class="bar-line" style="width:<?php echo $v['percent'];?>%"></div></div>
				<div class="tab">
					<span><strong><?php echo $v['target_amount'];?></strong>目标金额</span>
					<span style="text-align:center;"><strong><?php echo $v['day'];?></strong>剩余天数</span>
					<span><strong><?php echo $v['support'];?></strong>支持者</span>
					<div class="clear"></div>
				</div>
			</div>
		</div>
		<?php
}

?>		<div class="clear"></div>
	</div>
	<a href="<?php echo site_url('items');?>" class="item-more">更多项目 <i class="fa fa-caret-right"></i></a>
</div>

<div class="news">
	<div class="container">
		
<?php
foreach ($class as $k => $v) {
?>		<div class="news-col">
			<h3><a href="<?php echo site_url('article/index/' . $v['id']);?>" target="_blank"><?php echo $v['name'];?></a><a href="<?php echo site_url('article/index/' . $v['id']);?>" target="_blank" style="display:none;">更多>></a><div class="clear"></div></h3>
			
<?php
	if ($v['article']) {
?>			<ul>
				
<?php
		foreach ($v['article'] as $v1) {
?>				<li><a href="<?php echo site_url('article/info/' . $v1['id']);?>" target="_blank" title="<?php echo $v1['title'];?>"><?php echo mb_substr($v1['title'], 0, 13, 'utf-8');?>...</a><span><?php echo date('Y-m-d', $v1['add_time']);?></span><div class="clear"></div></li>
				<?php
		}

?>			</ul>
			<?php
	}
	else {
?>			<?php
	}

?>			<a href="<?php echo site_url('article/index/' . $v['id']);?>" target="_blank" class="more"><?php echo lang('home_more');?>>></a>
	    </div>
	    
	    <?php
}

?>	    <div class="clear"></div>
	</div>
</div>

<div class="service">
	<div class="container box">
		<div class="box-body">
			<div class="col-sm">
				<div class="service-icon">
					<i class="fa fa-lock"></i>
				</div>
				<h3><?php echo lang('home_service_1_tit');?></h3>
				<p><?php echo lang('home_service_1_txt');?></p>
			</div>
			<div class="col-sm">
				<div class="service-icon">
					<i class="fa fa-coffee"></i>
				</div>
				<h3><?php echo lang('home_service_2_tit');?></h3>
				<p><?php echo lang('home_service_2_txt');?></p>
			</div>
			<div class="col-sm">
				<div class="service-icon">
					<i class="fa fa-trophy"></i>
				</div>
				<h3><?php echo lang('home_service_3_tit');?></h3>
				<p><?php echo lang('home_service_3_txt');?></p>
			</div>
			<div class="col-sm">
				<div class="service-icon">
					<i class="fa fa-balance-scale"></i>
				</div>
				<h3><?php echo lang('home_service_4_tit');?></h3>
				<p><?php echo lang('home_service_4_txt');?></p>
			</div>
			<div class="clear"></div>
		</div>
	</div>
</div>
<div class="frend-link">
	<div class="frend-tit">—————————————————————— <strong>合作伙伴</strong> ————————————————————————</div>
	<div class="frend-list">
		<div class="container">
			
<?php
foreach ($partner as $v) {
?>			<a href="<?php echo $v['url'];?>" target="_blank"><img src="/upload/partner/<?php echo $v['img'];?>"></a>
			<?php
}

?>			<div class="clear"></div>
		</div>
	</div>
</div>
<script src="/static/js/index.js"></script>